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

Side by Side Diff: chrome/browser/sync/notifier/chrome_system_resources.h

Issue 5517004: sync: more debugging for crash in ChromeSystemResources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/debug
Patch Set: Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/sync/notifier/chrome_system_resources.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium 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 // Simple system resources class that uses the current message loop 5 // Simple system resources class that uses the current message loop
6 // for scheduling. Assumes the current message loop is already 6 // for scheduling. Assumes the current message loop is already
7 // running. 7 // running.
8 8
9 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_CHROME_SYSTEM_RESOURCES_H_ 9 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_CHROME_SYSTEM_RESOURCES_H_
10 #define CHROME_BROWSER_SYNC_NOTIFIER_CHROME_SYSTEM_RESOURCES_H_ 10 #define CHROME_BROWSER_SYNC_NOTIFIER_CHROME_SYSTEM_RESOURCES_H_
11 #pragma once 11 #pragma once
12 12
13 #include <set> 13 #include <set>
14 #include <string> 14 #include <string>
15 15
16 #include "base/message_loop.h"
16 #include "base/non_thread_safe.h" 17 #include "base/non_thread_safe.h"
17 #include "base/scoped_ptr.h" 18 #include "base/scoped_ptr.h"
18 #include "base/task.h" 19 #include "base/task.h"
19 #include "chrome/browser/sync/notifier/state_writer.h" 20 #include "chrome/browser/sync/notifier/state_writer.h"
20 #include "google/cacheinvalidation/invalidation-client.h" 21 #include "google/cacheinvalidation/invalidation-client.h"
21 22
22 namespace sync_notifier { 23 namespace sync_notifier {
23 24
24 class ChromeSystemResources : public invalidation::SystemResources { 25 class ChromeSystemResources : public invalidation::SystemResources {
25 public: 26 public:
(...skipping 25 matching lines...) Expand all
51 invalidation::StorageCallback* callback); 52 invalidation::StorageCallback* callback);
52 53
53 private: 54 private:
54 NonThreadSafe non_thread_safe_; 55 NonThreadSafe non_thread_safe_;
55 scoped_ptr<ScopedRunnableMethodFactory<ChromeSystemResources> > 56 scoped_ptr<ScopedRunnableMethodFactory<ChromeSystemResources> >
56 scoped_runnable_method_factory_; 57 scoped_runnable_method_factory_;
57 // Holds all posted tasks that have not yet been run. 58 // Holds all posted tasks that have not yet been run.
58 std::set<invalidation::Closure*> posted_tasks_; 59 std::set<invalidation::Closure*> posted_tasks_;
59 StateWriter* state_writer_; 60 StateWriter* state_writer_;
60 61
62 // TODO(tim): Trying to debug bug crbug.com/64652.
63 const MessageLoop* created_on_loop_;
64
61 // If the scheduler has been started, inserts |task| into 65 // If the scheduler has been started, inserts |task| into
62 // |posted_tasks_| and returns a Task* to post. Otherwise, 66 // |posted_tasks_| and returns a Task* to post. Otherwise,
63 // immediately deletes |task| and returns NULL. 67 // immediately deletes |task| and returns NULL.
64 Task* MakeTaskToPost(invalidation::Closure* task); 68 Task* MakeTaskToPost(invalidation::Closure* task);
65 69
66 // Runs the task, deletes it, and removes it from |posted_tasks_|. 70 // Runs the task, deletes it, and removes it from |posted_tasks_|.
67 void RunPostedTask(invalidation::Closure* task); 71 void RunPostedTask(invalidation::Closure* task);
68 72
69 // Runs the given storage callback with "true" and deletes it. 73 // Runs the given storage callback with "true" and deletes it.
70 void RunAndDeleteStorageCallback( 74 void RunAndDeleteStorageCallback(
71 invalidation::StorageCallback* callback); 75 invalidation::StorageCallback* callback);
72 }; 76 };
73 77
74 } // namespace sync_notifier 78 } // namespace sync_notifier
75 79
76 #endif // CHROME_BROWSER_SYNC_NOTIFIER_CHROME_SYSTEM_RESOURCES_H_ 80 #endif // CHROME_BROWSER_SYNC_NOTIFIER_CHROME_SYSTEM_RESOURCES_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/notifier/chrome_system_resources.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698