| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 27 matching lines...) Expand all Loading... |
| 38 #include "core/frame/LocalFrame.h" | 38 #include "core/frame/LocalFrame.h" |
| 39 #include "core/html/HTMLSlotElement.h" | 39 #include "core/html/HTMLSlotElement.h" |
| 40 #include "core/page/ChromeClient.h" | 40 #include "core/page/ChromeClient.h" |
| 41 #include "platform/probe/PlatformProbes.h" | 41 #include "platform/probe/PlatformProbes.h" |
| 42 | 42 |
| 43 namespace blink { | 43 namespace blink { |
| 44 | 44 |
| 45 class CoreProbeSink; | 45 class CoreProbeSink; |
| 46 class Resource; | 46 class Resource; |
| 47 class ThreadDebugger; | 47 class ThreadDebugger; |
| 48 class WorkerGlobalScope; | |
| 49 | 48 |
| 50 namespace probe { | 49 namespace probe { |
| 51 | 50 |
| 52 class CORE_EXPORT AsyncTask { | 51 class CORE_EXPORT AsyncTask { |
| 53 STACK_ALLOCATED(); | 52 STACK_ALLOCATED(); |
| 54 | 53 |
| 55 public: | 54 public: |
| 56 AsyncTask(ExecutionContext*, | 55 AsyncTask(ExecutionContext*, |
| 57 void* task, | 56 void* task, |
| 58 const char* step = nullptr, | 57 const char* step = nullptr, |
| 59 bool enabled = true); | 58 bool enabled = true); |
| 60 ~AsyncTask(); | 59 ~AsyncTask(); |
| 61 | 60 |
| 62 private: | 61 private: |
| 63 ThreadDebugger* debugger_; | 62 ThreadDebugger* debugger_; |
| 64 void* task_; | 63 void* task_; |
| 65 bool recurring_; | 64 bool recurring_; |
| 66 }; | 65 }; |
| 67 | 66 |
| 68 // Called from generated instrumentation code. | 67 // Called from generated instrumentation code. |
| 69 CORE_EXPORT CoreProbeSink* ToCoreProbeSink(WorkerGlobalScope*); | |
| 70 CORE_EXPORT CoreProbeSink* ToCoreProbeSinkForNonDocumentContext( | |
| 71 ExecutionContext*); | |
| 72 | |
| 73 inline CoreProbeSink* ToCoreProbeSink(LocalFrame* frame) { | 68 inline CoreProbeSink* ToCoreProbeSink(LocalFrame* frame) { |
| 74 return frame ? frame->InstrumentingAgents() : nullptr; | 69 return frame ? frame->InstrumentingAgents() : nullptr; |
| 75 } | 70 } |
| 76 | 71 |
| 77 inline CoreProbeSink* ToCoreProbeSink(Document& document) { | 72 inline CoreProbeSink* ToCoreProbeSink(Document& document) { |
| 78 LocalFrame* frame = document.GetFrame(); | 73 return document.GetProbeSink(); |
| 79 if (!frame && document.TemplateDocumentHost()) | |
| 80 frame = document.TemplateDocumentHost()->GetFrame(); | |
| 81 return ToCoreProbeSink(frame); | |
| 82 } | 74 } |
| 83 | 75 |
| 84 inline CoreProbeSink* ToCoreProbeSink(Document* document) { | 76 inline CoreProbeSink* ToCoreProbeSink(Document* document) { |
| 85 return document ? ToCoreProbeSink(*document) : nullptr; | 77 return document ? ToCoreProbeSink(*document) : nullptr; |
| 86 } | 78 } |
| 87 | 79 |
| 88 inline CoreProbeSink* ToCoreProbeSink(ExecutionContext* context) { | 80 inline CoreProbeSink* ToCoreProbeSink(ExecutionContext* context) { |
| 89 if (!context) | 81 return context ? context->GetProbeSink() : nullptr; |
| 90 return nullptr; | |
| 91 return context->IsDocument() ? ToCoreProbeSink(*ToDocument(context)) | |
| 92 : ToCoreProbeSinkForNonDocumentContext(context); | |
| 93 } | 82 } |
| 94 | 83 |
| 95 inline CoreProbeSink* ToCoreProbeSink(Node* node) { | 84 inline CoreProbeSink* ToCoreProbeSink(Node* node) { |
| 96 return node ? ToCoreProbeSink(node->GetDocument()) : nullptr; | 85 return node ? ToCoreProbeSink(node->GetDocument()) : nullptr; |
| 97 } | 86 } |
| 98 | 87 |
| 99 inline CoreProbeSink* ToCoreProbeSink(EventTarget* event_target) { | 88 inline CoreProbeSink* ToCoreProbeSink(EventTarget* event_target) { |
| 100 return event_target ? ToCoreProbeSink(event_target->GetExecutionContext()) | 89 return event_target ? ToCoreProbeSink(event_target->GetExecutionContext()) |
| 101 : nullptr; | 90 : nullptr; |
| 102 } | 91 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 123 unsigned long identifier, | 112 unsigned long identifier, |
| 124 const ResourceResponse&, | 113 const ResourceResponse&, |
| 125 Resource*); | 114 Resource*); |
| 126 | 115 |
| 127 } // namespace probe | 116 } // namespace probe |
| 128 } // namespace blink | 117 } // namespace blink |
| 129 | 118 |
| 130 #include "core/CoreProbesInl.h" | 119 #include "core/CoreProbesInl.h" |
| 131 | 120 |
| 132 #endif // !defined(CoreProbes_h) | 121 #endif // !defined(CoreProbes_h) |
| OLD | NEW |