OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2685 Handle<String> url_string = | 2685 Handle<String> url_string = |
2686 isolate->factory()->NewStringFromAscii(CStrVector("URL")); | 2686 isolate->factory()->NewStringFromAscii(CStrVector("URL")); |
2687 const char** urls = NewArray<const char*>(enumerator.count()); | 2687 const char** urls = NewArray<const char*>(enumerator.count()); |
2688 for (int i = 0, l = enumerator.count(); i < l; ++i) { | 2688 for (int i = 0, l = enumerator.count(); i < l; ++i) { |
2689 urls[i] = NULL; | 2689 urls[i] = NULL; |
2690 HandleScope scope; | 2690 HandleScope scope; |
2691 Handle<JSGlobalObject> global_obj = enumerator.at(i); | 2691 Handle<JSGlobalObject> global_obj = enumerator.at(i); |
2692 Object* obj_document; | 2692 Object* obj_document; |
2693 if (global_obj->GetProperty(*document_string)->ToObject(&obj_document) && | 2693 if (global_obj->GetProperty(*document_string)->ToObject(&obj_document) && |
2694 obj_document->IsJSObject()) { | 2694 obj_document->IsJSObject()) { |
| 2695 // FixMe: Workaround: SharedWorker's current Isolate has NULL context. |
| 2696 // As result GetProperty(*url_string) will crash. |
| 2697 if (!Isolate::Current()->context() && obj_document->IsJSGlobalProxy()) |
| 2698 continue; |
2695 JSObject* document = JSObject::cast(obj_document); | 2699 JSObject* document = JSObject::cast(obj_document); |
2696 Object* obj_url; | 2700 Object* obj_url; |
2697 if (document->GetProperty(*url_string)->ToObject(&obj_url) && | 2701 if (document->GetProperty(*url_string)->ToObject(&obj_url) && |
2698 obj_url->IsString()) { | 2702 obj_url->IsString()) { |
2699 urls[i] = collection_->names()->GetName(String::cast(obj_url)); | 2703 urls[i] = collection_->names()->GetName(String::cast(obj_url)); |
2700 } | 2704 } |
2701 } | 2705 } |
2702 } | 2706 } |
2703 | 2707 |
2704 AssertNoAllocation no_allocation; | 2708 AssertNoAllocation no_allocation; |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3557 | 3561 |
3558 | 3562 |
3559 void HeapSnapshotJSONSerializer::SortHashMap( | 3563 void HeapSnapshotJSONSerializer::SortHashMap( |
3560 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 3564 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
3561 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 3565 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
3562 sorted_entries->Add(p); | 3566 sorted_entries->Add(p); |
3563 sorted_entries->Sort(SortUsingEntryValue); | 3567 sorted_entries->Sort(SortUsingEntryValue); |
3564 } | 3568 } |
3565 | 3569 |
3566 } } // namespace v8::internal | 3570 } } // namespace v8::internal |
OLD | NEW |