133 -#if defined(OS_LINUX) || defined(OS_BSD) |
133 -#if defined(OS_LINUX) || defined(OS_BSD) |
134 +#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) |
134 +#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) |
135 NP_PLUGINUNIXINIT mInitializeFunc; |
135 NP_PLUGINUNIXINIT mInitializeFunc; |
136 #elif defined(OS_WIN) || defined(OS_MACOSX) |
136 #elif defined(OS_WIN) || defined(OS_MACOSX) |
137 NP_PLUGININIT mInitializeFunc; |
137 NP_PLUGININIT mInitializeFunc; |
138 diff --git a/dom/plugins/ipc/PluginProcessParent.cpp b/dom/plugins/ipc/PluginProcessParent.cpp |
|
139 --- a/dom/plugins/ipc/PluginProcessParent.cpp |
|
140 +++ b/dom/plugins/ipc/PluginProcessParent.cpp |
|
141 @@ -143,6 +143,9 @@ |
|
142 else if (base::PROCESS_ARCH_ARM & pluginLibArchitectures & containerArchitectures) { |
|
143 selectedArchitecture = base::PROCESS_ARCH_ARM; |
|
144 } |
|
145 + else if (base::PROCESS_ARCH_SPARC & pluginLibArchitectures & containerArchitectures) { |
|
146 + selectedArchitecture = base::PROCESS_ARCH_SPARC; |
|
147 + } |
|
148 else { |
|
149 return false; |
|
150 } |
|
151 diff --git a/ipc/chromium/chromium-config.mozbuild b/ipc/chromium/chromium-config.mozbuild |
138 diff --git a/ipc/chromium/chromium-config.mozbuild b/ipc/chromium/chromium-config.mozbuild |
152 --- a/ipc/chromium/chromium-config.mozbuild |
139 --- a/ipc/chromium/chromium-config.mozbuild |
153 +++ b/ipc/chromium/chromium-config.mozbuild |
140 +++ b/ipc/chromium/chromium-config.mozbuild |
154 @@ -45,6 +45,9 @@ |
141 @@ -45,6 +45,9 @@ |
155 if CONFIG['OS_ARCH'] == 'Darwin': |
142 if CONFIG['OS_ARCH'] == 'Darwin': |
159 + DEFINES['OS_SOLARIS'] = 1 |
146 + DEFINES['OS_SOLARIS'] = 1 |
160 + |
147 + |
161 elif CONFIG['OS_ARCH'] == 'DragonFly': |
148 elif CONFIG['OS_ARCH'] == 'DragonFly': |
162 DEFINES.update({ |
149 DEFINES.update({ |
163 'OS_DRAGONFLY': 1, |
150 'OS_DRAGONFLY': 1, |
164 diff --git a/ipc/chromium/moz.build b/ipc/chromium/moz.build |
|
165 --- a/ipc/chromium/moz.build |
|
166 +++ b/ipc/chromium/moz.build |
|
167 @@ -205,17 +205,25 @@ |
|
168 'moc_message_pump_qt.cc', |
|
169 ] |
|
170 if not CONFIG['MOZ_NATIVE_LIBEVENT']: |
|
171 - if CONFIG['OS_TARGET'] != 'Android': |
|
172 + if CONFIG['OS_TARGET'] != 'SunOS': |
|
173 + if CONFIG['OS_TARGET'] != 'Android': |
|
174 + SOURCES += [ |
|
175 + 'src/third_party/libevent/epoll_sub.c', |
|
176 + ] |
|
177 SOURCES += [ |
|
178 - 'src/third_party/libevent/epoll_sub.c', |
|
179 + 'src/third_party/libevent/epoll.c', |
|
180 ] |
|
181 - SOURCES += [ |
|
182 - 'src/third_party/libevent/epoll.c', |
|
183 - ] |
|
184 if CONFIG['OS_TARGET'] == 'Android': |
|
185 LOCAL_INCLUDES += ['src/third_party/libevent/android'] |
|
186 else: |
|
187 - LOCAL_INCLUDES += ['src/third_party/libevent/linux'] |
|
188 + if CONFIG['OS_TARGET'] != 'SunOS': |
|
189 + LOCAL_INCLUDES += ['src/third_party/libevent/linux'] |
|
190 + else: |
|
191 + LOCAL_INCLUDES += ['src/third_party/libevent/solaris'] |
|
192 + SOURCES += [ |
|
193 + 'src/third_party/libevent/devpoll.c', |
|
194 + 'src/third_party/libevent/evport.c', |
|
195 + ] |
|
196 |
|
197 if os_bsd: |
|
198 SOURCES += [ |
|
199 diff --git a/ipc/chromium/src/base/atomicops_internals_x86_gcc.cc b/ipc/chromium/src/base/atomicops_internals_x86_gcc.cc |
151 diff --git a/ipc/chromium/src/base/atomicops_internals_x86_gcc.cc b/ipc/chromium/src/base/atomicops_internals_x86_gcc.cc |
200 --- a/ipc/chromium/src/base/atomicops_internals_x86_gcc.cc |
152 --- a/ipc/chromium/src/base/atomicops_internals_x86_gcc.cc |
201 +++ b/ipc/chromium/src/base/atomicops_internals_x86_gcc.cc |
153 +++ b/ipc/chromium/src/base/atomicops_internals_x86_gcc.cc |
202 @@ -19,13 +19,13 @@ |
154 @@ -19,13 +19,13 @@ |
203 // Inline cpuid instruction. In PIC compilations, %ebx contains the address |
155 // Inline cpuid instruction. In PIC compilations, %ebx contains the address |
454 |
406 |
455 #endif // BASE_FILE_UTIL_H_ |
407 #endif // BASE_FILE_UTIL_H_ |
456 diff --git a/ipc/chromium/src/base/file_util_posix.cc b/ipc/chromium/src/base/file_util_posix.cc |
408 diff --git a/ipc/chromium/src/base/file_util_posix.cc b/ipc/chromium/src/base/file_util_posix.cc |
457 --- a/ipc/chromium/src/base/file_util_posix.cc |
409 --- a/ipc/chromium/src/base/file_util_posix.cc |
458 +++ b/ipc/chromium/src/base/file_util_posix.cc |
410 +++ b/ipc/chromium/src/base/file_util_posix.cc |
459 @@ -8,7 +8,7 @@ |
|
460 #include <errno.h> |
|
461 #include <fcntl.h> |
|
462 #include <fnmatch.h> |
|
463 -#ifndef ANDROID |
|
464 +#if !defined(ANDROID) && !defined(OS_SOLARIS) |
|
465 #include <fts.h> |
|
466 #endif |
|
467 #include <libgen.h> |
|
468 @@ -67,9 +67,34 @@ |
|
469 if (!recursive) |
|
470 return (rmdir(path_str) == 0); |
|
471 |
|
472 -#ifdef ANDROID |
|
473 +#if defined(ANDROID) |
|
474 // XXX Need ftsless impl for bionic |
|
475 return false; |
|
476 +#elif defined(OS_SOLARIS) |
|
477 + bool success = true; |
|
478 + std::stack<std::string> directories; |
|
479 + directories.push(path.value()); |
|
480 + FileEnumerator traversal(path, true, static_cast<FileEnumerator::FILE_TYPE>( |
|
481 + FileEnumerator::FILES | FileEnumerator::DIRECTORIES | |
|
482 + FileEnumerator::SHOW_SYM_LINKS)); |
|
483 + for (FilePath current = traversal.Next(); success && !current.empty(); |
|
484 + current = traversal.Next()) { |
|
485 + FileEnumerator::FindInfo info; |
|
486 + traversal.GetFindInfo(&info); |
|
487 + |
|
488 + if (S_ISDIR(info.stat.st_mode)) |
|
489 + directories.push(current.value()); |
|
490 + else |
|
491 + success = (unlink(current.value().c_str()) == 0); |
|
492 + } |
|
493 + |
|
494 + while (success && !directories.empty()) { |
|
495 + FilePath dir = FilePath(directories.top()); |
|
496 + directories.pop(); |
|
497 + success = (rmdir(dir.value().c_str()) == 0); |
|
498 + } |
|
499 + |
|
500 + return success; |
|
501 #else |
|
502 bool success = true; |
|
503 int ftsflags = FTS_PHYSICAL | FTS_NOSTAT; |
|
504 @@ -140,14 +165,98 @@ |
|
505 return false; |
|
506 } |
|
507 |
|
508 -#ifdef ANDROID |
|
509 +#if defined(ANDROID) |
|
510 // XXX Need ftsless impl for bionic |
|
511 return false; |
|
512 +#elif defined(OS_SOLARIS) |
|
513 + // This function does not properly handle destinations within the source |
|
514 + FilePath real_to_path = to_path; |
|
515 + if (PathExists(real_to_path)) { |
|
516 + if (!AbsolutePath(&real_to_path)) |
|
517 + return false; |
|
518 + } else { |
|
519 + real_to_path = real_to_path.DirName(); |
|
520 + if (!AbsolutePath(&real_to_path)) |
|
521 + return false; |
|
522 + } |
|
523 + FilePath real_from_path = from_path; |
|
524 + if (!AbsolutePath(&real_from_path)) |
|
525 + return false; |
|
526 + if (real_to_path.value().size() >= real_from_path.value().size() && |
|
527 + real_to_path.value().compare(0, real_from_path.value().size(), |
|
528 + real_from_path.value()) == 0) |
|
529 + return false; |
|
530 + |
|
531 + bool success = true; |
|
532 + FileEnumerator::FILE_TYPE traverse_type = |
|
533 + static_cast<FileEnumerator::FILE_TYPE>(FileEnumerator::FILES | |
|
534 + FileEnumerator::SHOW_SYM_LINKS); |
|
535 + if (recursive) |
|
536 + traverse_type = static_cast<FileEnumerator::FILE_TYPE>( |
|
537 + traverse_type | FileEnumerator::DIRECTORIES); |
|
538 + FileEnumerator traversal(from_path, recursive, traverse_type); |
|
539 + |
|
540 + // We have to mimic windows behavior here. |to_path| may not exist yet, |
|
541 + // start the loop with |to_path|. |
|
542 + FileEnumerator::FindInfo info; |
|
543 + FilePath current = from_path; |
|
544 + if (stat(from_path.value().c_str(), &info.stat) < 0) { |
|
545 + CHROMIUM_LOG(ERROR) << "CopyDirectory() couldn't stat source directory: " << |
|
546 + from_path.value() << " errno = " << errno; |
|
547 + success = false; |
|
548 + } |
|
549 + struct stat to_path_stat; |
|
550 + FilePath from_path_base = from_path; |
|
551 + if (recursive && stat(to_path.value().c_str(), &to_path_stat) == 0 && |
|
552 + S_ISDIR(to_path_stat.st_mode)) { |
|
553 + // If the destination already exists and is a directory, then the |
|
554 + // top level of source needs to be copied. |
|
555 + from_path_base = from_path.DirName(); |
|
556 + } |
|
557 + |
|
558 + // The Windows version of this function assumes that non-recursive calls |
|
559 + // will always have a directory for from_path. |
|
560 + DCHECK(recursive || S_ISDIR(info.stat.st_mode)); |
|
561 + |
|
562 + while (success && !current.empty()) { |
|
563 + // current is the source path, including from_path, so paste |
|
564 + // the suffix after from_path onto to_path to create the target_path. |
|
565 + std::string suffix(¤t.value().c_str()[from_path_base.value().size()]); |
|
566 + // Strip the leading '/' (if any). |
|
567 + if (!suffix.empty()) { |
|
568 + DCHECK_EQ('/', suffix[0]); |
|
569 + suffix.erase(0, 1); |
|
570 + } |
|
571 + const FilePath target_path = to_path.Append(suffix); |
|
572 + |
|
573 + if (S_ISDIR(info.stat.st_mode)) { |
|
574 + if (mkdir(target_path.value().c_str(), info.stat.st_mode & 01777) != 0 && |
|
575 + errno != EEXIST) { |
|
576 + CHROMIUM_LOG(ERROR) << "CopyDirectory() couldn't create directory: " << |
|
577 + target_path.value() << " errno = " << errno; |
|
578 + success = false; |
|
579 + } |
|
580 + } else if (S_ISREG(info.stat.st_mode)) { |
|
581 + if (!CopyFile(current, target_path)) { |
|
582 + CHROMIUM_LOG(ERROR) << "CopyDirectory() couldn't create file: " << |
|
583 + target_path.value(); |
|
584 + success = false; |
|
585 + } |
|
586 + } else { |
|
587 + CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping non-regular file: " << |
|
588 + current.value(); |
|
589 + } |
|
590 + |
|
591 + current = traversal.Next(); |
|
592 + traversal.GetFindInfo(&info); |
|
593 + } |
|
594 + |
|
595 + return success; |
|
596 #else |
|
597 char* dir_list[] = { top_dir, NULL }; |
|
598 FTS* fts = fts_open(dir_list, FTS_PHYSICAL | FTS_NOSTAT, NULL); |
|
599 if (!fts) { |
|
600 - CHROMIUM_LOG(ERROR) << "fts_open failed: " << strerror(errno); |
|
601 + CHROMIUM_CHROMIUM_LOG(ERROR) << "fts_open failed: " << strerror(errno); |
|
602 return false; |
|
603 } |
|
604 |
|
605 @@ -203,11 +312,11 @@ |
|
606 break; |
|
607 case FTS_SL: // Symlink. |
|
608 case FTS_SLNONE: // Symlink with broken target. |
|
609 - CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping symbolic link: " << |
|
610 + CHROMIUM_CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping symbolic link: " << |
|
611 ent->fts_path; |
|
612 continue; |
|
613 case FTS_DEFAULT: // Some other sort of file. |
|
614 - CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping file of unknown type: " << |
|
615 + CHROMIUM_CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping file of unknown type: " << |
|
616 ent->fts_path; |
|
617 continue; |
|
618 default: |
|
619 @@ -227,7 +336,7 @@ |
|
620 } |
|
621 |
|
622 if (error) { |
|
623 - CHROMIUM_LOG(ERROR) << "CopyDirectory(): " << strerror(error); |
|
624 + CHROMIUM_CHROMIUM_LOG(ERROR) << "CopyDirectory(): " << strerror(error); |
|
625 return false; |
|
626 } |
|
627 return true; |
|
628 @@ -446,7 +555,7 @@ |
411 @@ -446,7 +555,7 @@ |
629 } |
412 } |
630 |
413 |
631 bool GetShmemTempDir(FilePath* path) { |
414 bool GetShmemTempDir(FilePath* path) { |
632 -#if defined(OS_LINUX) && !defined(ANDROID) |
415 -#if defined(OS_LINUX) && !defined(ANDROID) |
974 +#endif |
757 +#endif |
975 + |
758 + |
976 #include <map> |
759 #include <map> |
977 #include <string> |
760 #include <string> |
978 #include <vector> |
761 #include <vector> |
979 @@ -71,7 +75,8 @@ |
762 @@ -86,8 +86,8 @@ |
980 PROCESS_ARCH_I386 = 0x1, |
|
981 PROCESS_ARCH_X86_64 = 0x2, |
|
982 PROCESS_ARCH_PPC = 0x4, |
|
983 - PROCESS_ARCH_ARM = 0x8 |
|
984 + PROCESS_ARCH_ARM = 0x8, |
|
985 + PROCESS_ARCH_SPARC = 0x10 |
|
986 }; |
|
987 |
|
988 inline ProcessArchitecture GetCurrentProcessArchitecture() |
|
989 @@ -85,6 +90,8 @@ |
|
990 currentArchitecture = base::PROCESS_ARCH_PPC; |
763 currentArchitecture = base::PROCESS_ARCH_PPC; |
991 #elif defined(ARCH_CPU_ARMEL) |
764 #elif defined(ARCH_CPU_ARMEL) |
992 currentArchitecture = base::PROCESS_ARCH_ARM; |
765 currentArchitecture = base::PROCESS_ARCH_ARM; |
993 +#elif defined(ARCH_CPU_SPARC) |
766 -#elif defined(ARCH_CPU_MIPS) |
994 + currentArchitecture = base::PROCESS_ARCH_SPARC; |
767 +#elif defined(ARCH_CPU_MIPS) || defined(ARCH_CPU_SPARC) |
|
768 currentArchitecture = base::PROCESS_ARCH_MIPS; |
995 #endif |
769 #endif |
996 return currentArchitecture; |
770 return currentArchitecture; |
997 } |
771 } |
998 diff --git a/ipc/chromium/src/base/process_util_posix.cc b/ipc/chromium/src/base/process_util_posix.cc |
772 diff --git a/ipc/chromium/src/base/process_util_posix.cc b/ipc/chromium/src/base/process_util_posix.cc |
999 --- a/ipc/chromium/src/base/process_util_posix.cc |
773 --- a/ipc/chromium/src/base/process_util_posix.cc |