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

Side by Side Diff: components/offline_pages/offline_page_item.cc

Issue 1345043002: Update access info when an offline page is being visited (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some more fixes Created 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "components/offline_pages/offline_page_item.h" 5 #include "components/offline_pages/offline_page_item.h"
6 6
7 #include "net/base/filename_util.h" 7 #include "net/base/filename_util.h"
8 8
9 namespace offline_pages { 9 namespace offline_pages {
10 10
11 namespace { 11 namespace {
12 const int kCurrentVersion = 1; 12 const int kCurrentVersion = 1;
13 } 13 }
14 14
15 OfflinePageItem::OfflinePageItem() 15 OfflinePageItem::OfflinePageItem()
16 : version(kCurrentVersion), 16 : version(kCurrentVersion),
17 file_size(0) { 17 file_size(0),
18 access_count(0) {
18 } 19 }
19 20
20 OfflinePageItem::OfflinePageItem(const GURL& url, 21 OfflinePageItem::OfflinePageItem(const GURL& url,
21 int64 bookmark_id, 22 int64 bookmark_id,
22 const base::FilePath& file_path, 23 const base::FilePath& file_path,
23 int64 file_size) 24 int64 file_size)
24 : url(url), 25 : url(url),
25 bookmark_id(bookmark_id), 26 bookmark_id(bookmark_id),
26 version(kCurrentVersion), 27 version(kCurrentVersion),
27 file_path(file_path), 28 file_path(file_path),
28 file_size(file_size) { 29 file_size(file_size),
30 access_count(0) {
29 } 31 }
30 32
31 OfflinePageItem::OfflinePageItem(const GURL& url, 33 OfflinePageItem::OfflinePageItem(const GURL& url,
32 int64 bookmark_id, 34 int64 bookmark_id,
33 const base::FilePath& file_path, 35 const base::FilePath& file_path,
34 int64 file_size, 36 int64 file_size,
35 const base::Time& creation_time) 37 const base::Time& creation_time)
36 : url(url), 38 : url(url),
37 bookmark_id(bookmark_id), 39 bookmark_id(bookmark_id),
38 version(kCurrentVersion), 40 version(kCurrentVersion),
39 file_path(file_path), 41 file_path(file_path),
40 file_size(file_size), 42 file_size(file_size),
41 creation_time(creation_time), 43 creation_time(creation_time),
42 last_access_time(creation_time) { 44 last_access_time(creation_time),
45 access_count(0) {
43 } 46 }
44 47
45 OfflinePageItem::~OfflinePageItem() { 48 OfflinePageItem::~OfflinePageItem() {
46 } 49 }
47 50
48 GURL OfflinePageItem::GetOfflineURL() const { 51 GURL OfflinePageItem::GetOfflineURL() const {
49 return net::FilePathToFileURL(file_path); 52 return net::FilePathToFileURL(file_path);
50 } 53 }
51 54
52 } // namespace offline_pages 55 } // namespace offline_pages
OLDNEW
« no previous file with comments | « components/offline_pages/offline_page_item.h ('k') | components/offline_pages/offline_page_metadata_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698