| OLD | NEW | 
|   1 /* |   1 /* | 
|   2  * Copyright (C) 2014 Google Inc. All rights reserved. |   2  * Copyright (C) 2014 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  43  |  43  | 
|  44 class GCTaskObserver final : public WebThread::TaskObserver { |  44 class GCTaskObserver final : public WebThread::TaskObserver { | 
|  45   USING_FAST_MALLOC(GCTaskObserver); |  45   USING_FAST_MALLOC(GCTaskObserver); | 
|  46  |  46  | 
|  47  public: |  47  public: | 
|  48   GCTaskObserver() : nesting_(0) {} |  48   GCTaskObserver() : nesting_(0) {} | 
|  49  |  49  | 
|  50   ~GCTaskObserver() { |  50   ~GCTaskObserver() { | 
|  51     // m_nesting can be 1 if this was unregistered in a task and |  51     // m_nesting can be 1 if this was unregistered in a task and | 
|  52     // didProcessTask was not called. |  52     // didProcessTask was not called. | 
|  53     ASSERT(!nesting_ || nesting_ == 1); |  53     DCHECK(!nesting_ || nesting_ == 1); | 
|  54   } |  54   } | 
|  55  |  55  | 
|  56   virtual void WillProcessTask() { nesting_++; } |  56   virtual void WillProcessTask() { nesting_++; } | 
|  57  |  57  | 
|  58   virtual void DidProcessTask() { |  58   virtual void DidProcessTask() { | 
|  59     // In the production code WebKit::initialize is called from inside the |  59     // In the production code WebKit::initialize is called from inside the | 
|  60     // message loop so we can get didProcessTask() without corresponding |  60     // message loop so we can get didProcessTask() without corresponding | 
|  61     // willProcessTask once. This is benign. |  61     // willProcessTask once. This is benign. | 
|  62     if (nesting_) |  62     if (nesting_) | 
|  63       nesting_--; |  63       nesting_--; | 
| (...skipping 20 matching lines...) Expand all  Loading... | 
|  84   ~GCTaskRunner() { thread_->RemoveTaskObserver(gc_task_observer_.get()); } |  84   ~GCTaskRunner() { thread_->RemoveTaskObserver(gc_task_observer_.get()); } | 
|  85  |  85  | 
|  86  private: |  86  private: | 
|  87   std::unique_ptr<GCTaskObserver> gc_task_observer_; |  87   std::unique_ptr<GCTaskObserver> gc_task_observer_; | 
|  88   WebThread* thread_; |  88   WebThread* thread_; | 
|  89 }; |  89 }; | 
|  90  |  90  | 
|  91 }  // namespace blink |  91 }  // namespace blink | 
|  92  |  92  | 
|  93 #endif |  93 #endif | 
| OLD | NEW |