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

Side by Side Diff: content/public/browser/web_contents_user_data.h

Issue 11087049: Fix comments per Avi's request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_USER_DATA_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_USER_DATA_H_
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_USER_DATA_H_ 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_USER_DATA_H_
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/supports_user_data.h" 9 #include "base/supports_user_data.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 // A base class for classes attached to, and scoped to, the lifetime of a 14 // A base class for classes attached to, and scoped to, the lifetime of a
15 // WebContents. For example: 15 // WebContents. For example:
16 // 16 //
17 // --- in foo_tab_helper.h --- 17 // --- in foo_tab_helper.h ---
18 // class FooTabHelper : public WebContentsUserData<FooTabHelper> { 18 // class FooTabHelper : public content::WebContentsUserData<FooTabHelper> {
19 // public: 19 // public:
20 // virtual ~FooTabHelper(); 20 // virtual ~FooTabHelper();
21 // // ... more public stuff here ... 21 // // ... more public stuff here ...
22 // private: 22 // private:
23 // explicit FooTabHelper(WebContents* contents); 23 // explicit FooTabHelper(content::WebContents* contents);
24 // friend class WebContentsUserData<FooTabHelper>; 24 // friend class content::WebContentsUserData<FooTabHelper>;
25 // // ... more private stuff here ... 25 // // ... more private stuff here ...
26 // } 26 // }
27 // --- in foo_tab_helper.cc --- 27 // --- in foo_tab_helper.cc ---
28 // DEFINE_WEB_CONTENTS_USER_DATA_KEY(FooTabHelper) 28 // DEFINE_WEB_CONTENTS_USER_DATA_KEY(FooTabHelper)
29 // 29 //
30 template <typename T> 30 template <typename T>
31 class WebContentsUserData : public base::SupportsUserData::Data { 31 class WebContentsUserData : public base::SupportsUserData::Data {
32 public: 32 public:
33 // Creates an object of type T, and attaches it to the specified WebContents. 33 // Creates an object of type T, and attaches it to the specified WebContents.
34 // If an instance is already attached, does nothing. 34 // If an instance is already attached, does nothing.
(...skipping 27 matching lines...) Expand all
62 // a declaration. Without it, this would be merely a declaration of a template 62 // a declaration. Without it, this would be merely a declaration of a template
63 // specialization. (C++98: 14.7.3.15; C++11: 14.7.3.13) 63 // specialization. (C++98: 14.7.3.15; C++11: 14.7.3.13)
64 // 64 //
65 #define DEFINE_WEB_CONTENTS_USER_DATA_KEY(TYPE) \ 65 #define DEFINE_WEB_CONTENTS_USER_DATA_KEY(TYPE) \
66 template<> \ 66 template<> \
67 int content::WebContentsUserData<TYPE>::kLocatorKey = 0; 67 int content::WebContentsUserData<TYPE>::kLocatorKey = 0;
68 68
69 } // namespace content 69 } // namespace content
70 70
71 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_USER_DATA_H_ 71 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_USER_DATA_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698