Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp

Issue 2011983003: DevTools: fix crash upon non-initialized IdentifiersFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 Google Inc. All rights reserved. 2 * Copyright (c) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "core/frame/UseCounter.h" 46 #include "core/frame/UseCounter.h"
47 #include "core/inspector/IdentifiersFactory.h" 47 #include "core/inspector/IdentifiersFactory.h"
48 #include "core/inspector/InspectedFrames.h" 48 #include "core/inspector/InspectedFrames.h"
49 #include "core/inspector/InspectorTaskRunner.h" 49 #include "core/inspector/InspectorTaskRunner.h"
50 #include "core/timing/MemoryInfo.h" 50 #include "core/timing/MemoryInfo.h"
51 #include "core/workers/MainThreadWorkletGlobalScope.h" 51 #include "core/workers/MainThreadWorkletGlobalScope.h"
52 #include "core/xml/XPathEvaluator.h" 52 #include "core/xml/XPathEvaluator.h"
53 #include "core/xml/XPathResult.h" 53 #include "core/xml/XPathResult.h"
54 #include "platform/UserGestureIndicator.h" 54 #include "platform/UserGestureIndicator.h"
55 #include "platform/v8_inspector/public/V8Debugger.h" 55 #include "platform/v8_inspector/public/V8Debugger.h"
56 #include "public/platform/Platform.h"
57 #include "wtf/OwnPtr.h" 56 #include "wtf/OwnPtr.h"
58 #include "wtf/PassOwnPtr.h" 57 #include "wtf/PassOwnPtr.h"
59 #include "wtf/ThreadingPrimitives.h" 58 #include "wtf/ThreadingPrimitives.h"
60 59
61 namespace blink { 60 namespace blink {
62 61
63 namespace { 62 namespace {
64 63
65 int frameId(LocalFrame* frame) 64 int frameId(LocalFrame* frame)
66 { 65 {
(...skipping 13 matching lines...) Expand all
80 // owner one; does not enable heap-movable objects. 79 // owner one; does not enable heap-movable objects.
81 MainThreadDebugger* MainThreadDebugger::s_instance = nullptr; 80 MainThreadDebugger* MainThreadDebugger::s_instance = nullptr;
82 81
83 MainThreadDebugger::MainThreadDebugger(v8::Isolate* isolate) 82 MainThreadDebugger::MainThreadDebugger(v8::Isolate* isolate)
84 : ThreadDebugger(isolate) 83 : ThreadDebugger(isolate)
85 , m_taskRunner(adoptPtr(new InspectorTaskRunner())) 84 , m_taskRunner(adoptPtr(new InspectorTaskRunner()))
86 { 85 {
87 MutexLocker locker(creationMutex()); 86 MutexLocker locker(creationMutex());
88 ASSERT(!s_instance); 87 ASSERT(!s_instance);
89 s_instance = this; 88 s_instance = this;
90 IdentifiersFactory::setProcessId(Platform::current()->getUniqueIdForProcess( ));
91 } 89 }
92 90
93 MainThreadDebugger::~MainThreadDebugger() 91 MainThreadDebugger::~MainThreadDebugger()
94 { 92 {
95 MutexLocker locker(creationMutex()); 93 MutexLocker locker(creationMutex());
96 ASSERT(s_instance == this); 94 ASSERT(s_instance == this);
97 s_instance = nullptr; 95 s_instance = nullptr;
98 } 96 }
99 97
100 void MainThreadDebugger::setClientMessageLoop(PassOwnPtr<ClientMessageLoop> clie ntMessageLoop) 98 void MainThreadDebugger::setClientMessageLoop(PassOwnPtr<ClientMessageLoop> clie ntMessageLoop)
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 return; 347 return;
350 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get Isolate())).FromMaybe(false)) 348 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get Isolate())).FromMaybe(false))
351 return; 349 return;
352 } 350 }
353 info.GetReturnValue().Set(nodes); 351 info.GetReturnValue().Set(nodes);
354 } 352 }
355 exceptionState.throwIfNeeded(); 353 exceptionState.throwIfNeeded();
356 } 354 }
357 355
358 } // namespace blink 356 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698