| OLD | NEW |
| 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 | 5 |
| 6 //------------------------------------------------------------------------------ | 6 //------------------------------------------------------------------------------ |
| 7 // Description of the life cycle of a instance of MetricsService. | 7 // Description of the life cycle of a instance of MetricsService. |
| 8 // | 8 // |
| 9 // OVERVIEW | 9 // OVERVIEW |
| 10 // | 10 // |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 public: | 203 public: |
| 204 explicit ChromeFrameUploadRequestContextGetter(MessageLoop* io_loop) | 204 explicit ChromeFrameUploadRequestContextGetter(MessageLoop* io_loop) |
| 205 : io_loop_(io_loop) {} | 205 : io_loop_(io_loop) {} |
| 206 | 206 |
| 207 virtual URLRequestContext* GetURLRequestContext() { | 207 virtual URLRequestContext* GetURLRequestContext() { |
| 208 if (!context_) | 208 if (!context_) |
| 209 context_ = new ChromeFrameUploadRequestContext(io_loop_); | 209 context_ = new ChromeFrameUploadRequestContext(io_loop_); |
| 210 return context_; | 210 return context_; |
| 211 } | 211 } |
| 212 | 212 |
| 213 virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() { | 213 virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const { |
| 214 if (!io_message_loop_proxy_.get()) { | 214 if (!io_message_loop_proxy_.get()) { |
| 215 io_message_loop_proxy_ = base::MessageLoopProxy::CreateForCurrentThread(); | 215 io_message_loop_proxy_ = base::MessageLoopProxy::CreateForCurrentThread(); |
| 216 } | 216 } |
| 217 return io_message_loop_proxy_; | 217 return io_message_loop_proxy_; |
| 218 } | 218 } |
| 219 | 219 |
| 220 private: | 220 private: |
| 221 ~ChromeFrameUploadRequestContextGetter() { | 221 ~ChromeFrameUploadRequestContextGetter() { |
| 222 DVLOG(1) << __FUNCTION__; | 222 DVLOG(1) << __FUNCTION__; |
| 223 } | 223 } |
| 224 | 224 |
| 225 scoped_refptr<URLRequestContext> context_; | 225 scoped_refptr<URLRequestContext> context_; |
| 226 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 226 mutable scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
| 227 MessageLoop* io_loop_; | 227 MessageLoop* io_loop_; |
| 228 }; | 228 }; |
| 229 | 229 |
| 230 // This class provides functionality to upload the ChromeFrame UMA data to the | 230 // This class provides functionality to upload the ChromeFrame UMA data to the |
| 231 // server. An instance of this class is created whenever we have data to be | 231 // server. An instance of this class is created whenever we have data to be |
| 232 // uploaded to the server. | 232 // uploaded to the server. |
| 233 class ChromeFrameMetricsDataUploader | 233 class ChromeFrameMetricsDataUploader |
| 234 : public URLFetcher::Delegate, | 234 : public URLFetcher::Delegate, |
| 235 public base::RefCountedThreadSafe<ChromeFrameMetricsDataUploader>, | 235 public base::RefCountedThreadSafe<ChromeFrameMetricsDataUploader>, |
| 236 public CWindowImpl<ChromeFrameMetricsDataUploader>, | 236 public CWindowImpl<ChromeFrameMetricsDataUploader>, |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 version += "-F"; | 598 version += "-F"; |
| 599 if (!version_info.IsOfficialBuild()) | 599 if (!version_info.IsOfficialBuild()) |
| 600 version.append("-devel"); | 600 version.append("-devel"); |
| 601 return version; | 601 return version; |
| 602 } else { | 602 } else { |
| 603 NOTREACHED() << "Unable to retrieve version string."; | 603 NOTREACHED() << "Unable to retrieve version string."; |
| 604 } | 604 } |
| 605 | 605 |
| 606 return std::string(); | 606 return std::string(); |
| 607 } | 607 } |
| OLD | NEW |