| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 | 5 |
| 6 // Defined when linking against shared lib on Windows. | 6 // Defined when linking against shared lib on Windows. |
| 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) | 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) |
| 8 #define V8_SHARED | 8 #define V8_SHARED |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1699 Handle<Function> postmessage_fun; | 1699 Handle<Function> postmessage_fun; |
| 1700 if (postmessage_fun_template->GetFunction(context) | 1700 if (postmessage_fun_template->GetFunction(context) |
| 1701 .ToLocal(&postmessage_fun)) { | 1701 .ToLocal(&postmessage_fun)) { |
| 1702 global->Set(String::NewFromUtf8(isolate, "postMessage"), | 1702 global->Set(String::NewFromUtf8(isolate, "postMessage"), |
| 1703 postmessage_fun); | 1703 postmessage_fun); |
| 1704 } | 1704 } |
| 1705 | 1705 |
| 1706 // First run the script | 1706 // First run the script |
| 1707 Handle<String> file_name = String::NewFromUtf8(isolate, "unnamed"); | 1707 Handle<String> file_name = String::NewFromUtf8(isolate, "unnamed"); |
| 1708 Handle<String> source = String::NewFromUtf8(isolate, script_); | 1708 Handle<String> source = String::NewFromUtf8(isolate, script_); |
| 1709 if (Shell::ExecuteString(isolate, source, file_name, true, true)) { | 1709 if (Shell::ExecuteString(isolate, source, file_name, false, true)) { |
| 1710 // Get the message handler | 1710 // Get the message handler |
| 1711 Handle<Value> onmessage = | 1711 Handle<Value> onmessage = |
| 1712 global->Get(String::NewFromUtf8(isolate, "onmessage")); | 1712 global->Get(String::NewFromUtf8(isolate, "onmessage")); |
| 1713 if (onmessage->IsFunction()) { | 1713 if (onmessage->IsFunction()) { |
| 1714 Handle<Function> onmessage_fun = Handle<Function>::Cast(onmessage); | 1714 Handle<Function> onmessage_fun = Handle<Function>::Cast(onmessage); |
| 1715 // Now wait for messages | 1715 // Now wait for messages |
| 1716 bool done = false; | 1716 bool done = false; |
| 1717 while (!done) { | 1717 while (!done) { |
| 1718 in_semaphore_.Wait(); | 1718 in_semaphore_.Wait(); |
| 1719 SerializationData* data; | 1719 SerializationData* data; |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2428 } | 2428 } |
| 2429 | 2429 |
| 2430 } // namespace v8 | 2430 } // namespace v8 |
| 2431 | 2431 |
| 2432 | 2432 |
| 2433 #ifndef GOOGLE3 | 2433 #ifndef GOOGLE3 |
| 2434 int main(int argc, char* argv[]) { | 2434 int main(int argc, char* argv[]) { |
| 2435 return v8::Shell::Main(argc, argv); | 2435 return v8::Shell::Main(argc, argv); |
| 2436 } | 2436 } |
| 2437 #endif | 2437 #endif |
| OLD | NEW |